package cn.thoughtworks.school.usercenter.controllers;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping(value = "/api/inspector")
public class InspectorController {

    @Value("${spring.application.name}")
    private String applicationName;

    @Value("${spring.profiles.active: default}")
    private String profiles;

    @RequestMapping(method = RequestMethod.GET)
    ResponseEntity getAppInfo() throws Exception {
        Map<String, String> appInfo = new HashMap();
        appInfo.put("applicationName", applicationName);
        appInfo.put("profiles", profiles);
        return new ResponseEntity(appInfo, HttpStatus.OK);//发送邮件成功
    }

}
